<template>
  <el-button type="primary" size="default" @click="addBtn">增加</el-button>

  <div>
    {{ count }}
  </div>
</template>

<script setup lang="ts">
import { testStore } from '@/store/test';
import { computed } from 'vue';

//获取store
const store = testStore();
//展示const到页面
const count = computed(() => {
  return store.count;
})
//增加count
const addBtn = () => {
  //store.count++  方式一
  //store.setCount(++store.count) 常用这种方式
  //store.$patch({ count: ++store.count });
  // store.$patch((state) => {
  //   state.count++;
  // });
}
</script>

<style lang="scss" scoped></style>
